﻿<UserControl x:Class="SQLServerOptimizer.PL.WPF.AutoFixControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:viewer="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
             mc:Ignorable="d"
			 xmlns:s="clr-namespace:System;assembly=mscorlib" 
            
             Name="AutofixControl"
             xmlns:sys="clr-namespace:System;assembly=mscorlib" 
             xmlns:local="clr-namespace:SQLServerOptimizer.PL.WPF"
             
              xmlns:dw="clr-namespace:DrWPF.Windows.Controls" Loaded="UserControl_Loaded" Width="Auto" Height="Auto">


    <UserControl.Resources>
        
        <ResourceDictionary>
            <!-- Load this specific theme because the Aero theme for CheckBox has issues. -->

            <Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
                <Setter Property="IsExpanded"
          Value="{Binding IsNodeExpanded}" />
                <Setter Property="IsSelected" Value="{Binding IsInitiallySelected, Mode=OneTime}" />
                <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
            </Style>

            <Style x:Key="SeverityStyle" TargetType="ListViewItem">
                
                 <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
                <Setter Property="dw:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
            </Style>

            <HierarchicalDataTemplate 
        x:Key="CheckBoxItemTemplate"
        ItemsSource="{Binding Children, Mode=OneTime}"
        >
                <StackPanel Orientation="Horizontal">
                    <!-- These elements are bound to a FooViewModel object. -->
                    <CheckBox
            Focusable="False" 
            IsChecked="{Binding IsChecked}" 
            VerticalAlignment="Center"
           
                       
            />
                    <ContentControl  Content="{Binding Name ,  Mode=OneTime}" Foreground="{Binding kleur}" FontFamily="Arial" FontSize="12"  Margin="5,0"/>


                </StackPanel>
            </HierarchicalDataTemplate>



          


        </ResourceDictionary>
    </UserControl.Resources>
    <UserControl.DataContext>
        <ObjectDataProvider x:Name="data"       MethodName="CreateIssues"
      ObjectType="{x:Type local:IssueViewModel}" />
    </UserControl.DataContext>
    <Grid >

        <Grid.ColumnDefinitions>
           


            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid Width="0" Height="0" Visibility="Hidden" >
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="20"/>

            </Grid.ColumnDefinitions>
            <Button 
    		HorizontalAlignment="Left" 
    		 VerticalAlignment="Top"
    		x:Name="btnLoad" 
                 Height="34"
Grid.Row="1" Grid.Column="1"
                Width="37" Background="#FF7CDDFD"  
    		ToolTip="Refresh Results"  RenderTransformOrigin="1.457,0.529" d:LayoutOverrides="HorizontalAlignment" Click="btnLoad_Click" Margin="20,0,0,0" OverridesDefaultStyle="True">

                <Image  Width="32" Height="22" Source="Images\refresh.png"  />
            </Button>

            <Label Content="Instance" HorizontalAlignment="Left" 
               Foreground="White" FontSize="9.333" Grid.Row="2" d:LayoutOverrides="Height" Background="#00000000"/>
            <Label Content="Database" Grid.Row="3" Foreground="White" FontSize="9.333" HorizontalAlignment="Left" d:LayoutOverrides="Height"/>
            <Label Content="Severity" FontSize="9.333" Foreground="White" x:Name="label1f" Grid.Row="4" HorizontalAlignment="Left" Height="20.065" VerticalAlignment="Top" />
            <Label Content="Expand" FontSize="9.333" Foreground="White" x:Name="lblExpandf" Grid.Row="5" HorizontalAlignment="Left" Height="20.065" VerticalAlignment="Top" />

            <ComboBox 
          
            x:Name="combobox_servicefilter" 
          Grid.Row="2" 
            d:LayoutOverrides="VerticalAlignment" Grid.Column="1" SelectionChanged="combobox_servicefilter_SelectionChanged" />

            <ComboBox 
    	
    		x:Name="combobox_databasefilter" Grid.Row="3"
    		 VerticalAlignment="Bottom" Grid.Column="1" Height="20" SelectionChanged="combobox_databasefilter_SelectionChanged" />

            <local:SeverityList  x:Name="Severity" Grid.Row="4" Grid.Column="1" Width="Auto" Height="Auto" />
                       
                       
                       
                   
            <Button Height="34"  VerticalAlignment="Bottom" Click="button1_Click"  Background="#FF7CDDFD" ToolTip="Start Check" Width="37" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalMargin" Grid.Row="7" Grid.Column="1" Margin="20,0,0,25">
                <Image Name="image_start" Width="32" Height="31" Source="Images\start.png" />
            </Button>

            <ComboBox 
    		x:Name="combobox_Expand" 
    		
    		SelectedIndex="0" Background="White" Grid.Row="5" Grid.Column="1" SelectionChanged="combobox_Expand_SelectionChanged">
                <sys:String>None</sys:String>
                <sys:String>Instances</sys:String>
                <sys:String>Issues</sys:String>
            </ComboBox>
            <Label Content="Auto Fixes" Height="55" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="285" FontSize="32" FontFamily="Trebuchet MS" Foreground="White" />
        </Grid>
        <DockPanel Grid.Column="1" LastChildFill="True">
        	<Label Content="SQL Server Issues" DockPanel.Dock="Top"  x:Name="label3" FontWeight="Bold" FontSize="16" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top"  />
        	<Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="0">
        		<TreeView  Height="Auto" VerticalAlignment="Stretch"   
        			x:Name="tree"
                     
        			Background="{x:Null}"
        			ItemContainerStyle="{StaticResource TreeViewItemStyle}"
        			ItemsSource="{Binding Mode=OneTime}"
        			ItemTemplate="{StaticResource CheckBoxItemTemplate}" VerticalContentAlignment="Stretch" BorderThickness="0" d:LayoutOverrides="Width, Height" HorizontalContentAlignment="Stretch" Margin="5" FontSize="26.667" FontFamily="/SQLServerOptimizer.PL.WPF;component/Fonts/#Arial" FontWeight="Bold" />
        	</Border>
        	
	    </DockPanel>

    </Grid>

</UserControl>
